package com.netty.esc.service.action;

import com.alibaba.fastjson.JSONObject;
import com.netty.esc.entity.send.PongDTO;
import com.netty.esc.common.enums.WSProtocolTypeEM;
import com.netty.esc.config.websocket.WebSocketManager;
import io.netty.channel.ChannelHandlerContext;
import org.springframework.stereotype.Service;


/**
 * @ClassName: 11094
 * @Description:
 * @Author: Fisher
 * @Date: 2022/6/5 1:15
 **/
@Service
public class HeartBaseAction extends BaseAction {

    /**
     * 心跳
     * */
    @ActionType(WSProtocolTypeEM.PING_PROT)
    public static void heart(ChannelHandlerContext ctx, JSONObject jsonObject){
        PongDTO pongDTO = new PongDTO();
        WebSocketManager.sendTextMessage(ctx, pongDTO);
    }

}
